<template>
    <div id="single-blog">
        <h1>{{blog.title}}</h1>
        <article>{{blog.body}}</article>
    </div>
</template>

<script>
    export default{
        name:"single-blog",
        data(){
            return{
                id:this.$route.params.id,
                blog:{}
            }
        },
        created(){
            this.$http.get('http://jsonplaceholder.typicode.com/posts/' + this.id)
            .then(function(data){
                console.log(data);
                this.blog = data.body;
            })
        }
    }

</script>

<style scoped>
    #single-blog{
        max-width: 1200px;
        margin: 0 10px;
        padding: 20px;
        background: gainsboro;
        border: 1px dotted #aaa;
    }
</style>